{% extends 'admin.twig' %}

{% block body %}
<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            
            {% if errors is defined %}
            <div style="margin-top: 25px;margin-bottom:5px;" class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                {{ errors }}
            </div>
            {% endif %}

            <div class="login-panel panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Please Sign In</h3>
                </div>
                <div class="panel-body">
                    <form role="form" action="{{ path_for('doLogin') }}" method="POST">
                        <input name="{{csrf.valueKey}}" type="hidden" value="{{csrf.value}}">
                        <input name="{{csrf.nameKey}}" type="hidden" value="{{csrf.name}}">

                        <fieldset>
                            {% if auth_type=='login' %}
                                <div class="form-group">
                                    <input class="form-control" placeholder="Login" name="login" type="text" autofocus>
                                </div>
                            {% else %}
                                <div class="form-group">
                                    <input class="form-control" placeholder="E-mail" name="email" type="email" autofocus>
                                </div>
                            {% endif %}

                            <div class="form-group">
                                <input class="form-control" placeholder="Password" name="password" type="password" value="">
                            </div>
                            <div class="checkbox">
                                <label>
                                    <input name="remember" type="checkbox" value="Remember Me">Remember Me
                                </label>
                            </div>
                            <!-- Change this to a button or input when using this as a form -->
                            <button type="success" class="btn btn-lg btn-success btn-block">Login</button>
                        </fieldset>
                    </form>
                </div>
                <div class="panel-footer">
                    <a href="/">&lt; Back to site</a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}